<div id="page-title">
	<img
		src="<{$APPLICATION_URL}>/Themes/Default/Images/res-img/news.png"
		width="50" height="50" class="left-align service-icn "
		alt="Create A News Article">
	<h1 class="page-heading">Create A News Article</h1>
</div>

<div id="breadcrumb" class="transparent">
	<p>
		<img src="<{$APPLICATION_URL}>/Themes/Default/Images/res-img/home.png" class="home" alt="Slappit.com"> <a href="<{$APPLICATION_URL}>/Browse/index" title="Slappit.com Homepage">Home</a> / <a href="<{$APPLICATION_URL}>/Browse/MyAccount/index" title="Slappit.com User Panel">Website Admin Panel</a> / <a href="<{$APPLICATION_URL}>/Browse/NewsPanel/index" title="News Panel">News Panel</a> / <a href="<{$APPLICATION_URL}>/Browse/NewsPanel/create" title="Create A News Article">Create A News Article</a>

</div>
<div id="main-content">
	<article id="main-article">
	<ul id="filtering-nav">
		<li><a href="<{$APPLICATION_URL}>/Browse/MyAccount/index" title="Back To Main User Panel">Back To Main User Panel</a></li>
		<li><a href="<{$APPLICATION_URL}>/Browse/NewsPanel/index" title="Back to the news panel">Back To The News Panel</a></li>
		<li><a href="<{$APPLICATION_URL}>/Browse/Category/index/type/news" title="News Category Panel">News Category Panel</a></li>
        					<li><a href="<{$currentUser->getHomeUrl()}>" target="blank" title="View Website Homepage">View Website Homepage</a></li>
	</ul>
					<{if $isDemoMode == true}>
					<p><h3 style="font-family:arial"><font color="red">THIS IS DEMO MODE. YOU CANNOT EDIT ANY INFORMATION HERE</font></h3><br/>
					</p>
					<{/if}>
	<{if $countCatList == 0}>
		<p>
			<h3 style="font-family:arial">PLEASE ADD CATEGORY BEFORE ADD NEW ITEM</h3><br/>
		</p>
	<{/if}>
	<form action="<{$APPLICATION_URL}>/Browse/NewsPanel/create" method="post" id="save-content" name="save_content" enctype="multipart/form-data">
		<ol class="forms">			
			<li>
				<h2>Meta Section</h2>
				<p>
					<small>(Enter the title for your website here) Example: Domain.com
						- Buy computer parts here</small>
				</p></li>
			<li><label for="headTitle">Meta Title</label><input type="text"
				id="headTitle" name="headTitle" value="" <{if $isDemoMode == true}>readonly="readonly"<{/if}>></li>
			<li><p>
					<small>(Enter the description for your website here) Example:
						Domain.com - you can buy monitors, computer parts and network
						systems.</small>
				</p></li>
			<li><label for="metaDescription">Meta Desc</label><input type="text"
				id="metaDescription" name="metaDescription" value="" <{if $isDemoMode == true}>readonly="readonly"<{/if}>></li>
			<li><p>
					<small>(Enter the keywords for your website here) Example: Company
						Name, computers, monitors, components</small>
				</p></li>
			<li><label for="metaKeywords">Meta Keywords</label><input type="text"
				id="metaKeywords" name="metaKeywords" value="" <{if $isDemoMode == true}>readonly="readonly"<{/if}>></li>
			<li><br> <br>
				<h2>Content Area</h2></li>
			<li><p>
					<small>(Enter the main title for this page) Example: Domain.com -
						The number 1 place for computer parts</small>
				</p></li>
			<li><label for="title">Page Main Title</label><input type="text"
				id="title" name="title" value="" <{if $isDemoMode == true}>readonly="readonly"<{/if}>></li>
			<li><label for="categoryId" style="padding-right:20px;">Select Category</label>
				<select name="categoryId" id="categoryId" >
						<{foreach name=outer item=catItem from=$categoryList}>												
							<option value="<{$catItem->id}>" <{if $categoryId == $catItem->id}> selected="selected" <{/if}>><{$catItem->name}></option>							
						<{/foreach}>
				</select>
			</li>
			<li><label for="title">Picture</label><input type='file' id='picture' name='picture' style='padding: 0px;'></li>
			<li><p>
					<small>Enter all your page content here</small>
				</p></li>
			<li><textarea name="content" id="content" cols="30" rows="12"><{$content}></textarea></li>
			<li><a id="submit-form" class="silver-button" <{if $isDemoMode == false}>onclick="return formSubmit();"<{/if}>>Save</a></li>
		</ol>
		<input type="hidden" id="actionForm" name="actionForm" value=""/>
	</form>
	<div id="service-page">
		<div class="clear"></div>
	</div>

	</article>

</div>
<div class="space transparent">
	<a href="#top" id="scroll-top"><img
		src="<{$APPLICATION_URL}>/Themes/Default/Images/res-img/top.png"
		alt="Back to the top"> </a>
</div>


<script type="text/javascript">
    function formSubmit()
    {
    	var theform = document.save_content;
    	
    	// Check Name
    	var title = theform.title.value;
    	if (title == ''){
			alert('Title is invalid');
			theform.title.focus();
			return false;
    	} 	
    	

    	theform.actionForm.value = 'submit';
    	theform.submit();
    	return true;
    }
</script>
<script type="text/javascript" src="<{$APPLICATION_URL}>/Libraries/External/fckeditor/fckeditor.js"></script>
<script type="text/javascript">
<!--
/*
var sToolbar;
var oFCKeditor = new FCKeditor('news_body');
oFCKeditor.BasePath = "./include/fckeditor/";
var sSkinPath = 'skins/silver/'; 	                  

oFCKeditor.Config["CustomConfigurationsPath"] = "../../js/blog_fckconfig.js";
oFCKeditor.Config["DefaultLanguage"] = "{$language_code}";
oFCKeditor.Config['AutoDetectLanguage'] = false;
oFCKeditor.Height = "300";
oFCKeditor.Width = "502";
oFCKeditor.ToolbarSet = "se_blog";

oFCKeditor.Config['SkinPath'] = sSkinPath;
oFCKeditor.ReplaceTextarea() ;
//FCKeditor.ReplaceAllTextareas();
*/
	var textareaToEditor = function( textarea )
	{
		var editor = new FCKeditor( textarea.name ) ;
	
		//editor.Width = Math.max( textarea.offsetWidth, FCKeditor.MinWidth ) ;
		//editor.Height = Math.max( textarea.offsetHeight, FCKeditor.MinHeight ) ;
		editor.BasePath = "<{$APPLICATION_URL}>/Libraries/External/fckeditor/";
		editor.Config["CustomConfigurationsPath"] = "<{$APPLICATION_URL}>/Libraries/External/fckeditor/blog_fckconfig.js";
     	editor.Config["DefaultLanguage"] = "en";
    	editor.Config['AutoDetectLanguage'] = false;
    	editor.Height = "500";
    	editor.Width = "100%";
    	//editor.ToolbarSet = "se_blog";
    
    	editor.Config['SkinPath'] = 'skins/silver/';
		return editor ;
	};
	
	FCKeditor.ReplaceAllTextareas = function()
	{
		var textareas = document.getElementsByTagName( 'textarea' ) ;

		for ( var i = 0 ; i < textareas.length ; i++ )
		{
			var editor = null ;
			var textarea = textareas[i] ;
			var name = textarea.name ;

			// The "name" attribute must exist.
			if ( !name || name.length == 0 )
				continue ;

			if ( typeof arguments[0] == 'string' )
			{
				// The textarea class name could be passed as the function
				// parameter.

				var classRegex = new RegExp( '(?:^| )' + arguments[0] + '(?:$| )' ) ;

				if ( !classRegex.test( textarea.className ) )
					continue ;
			}
			else if ( typeof arguments[0] == 'function' )
			{
				// An assertion function could be passed as the function parameter.
				// It must explicitly return "false" to ignore a specific <textarea>.
				editor = textareaToEditor( textarea ) ;
				if ( arguments[0]( textarea, editor ) === false )
					continue ;
			}

			if ( !editor )
				editor = textareaToEditor( textarea ) ;

			editor.ReplaceTextarea() ;
		}
	};	                  
	FCKeditor.ReplaceAllTextareas();
//-->
</script>